﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using Century.Model.CMS;


namespace Century.Model
{
    public class CenturyDbContext : DbContext
    {
        public DbSet<ActionModule> ActionModules { get; set; }
        public DbSet<ActionModuleRole> ActionModuleRoles { get; set; }
        public DbSet<SystemConfiguration> SystemConfigurations { get; set; }
        public DbSet<CharValue> CharValues { get; set; }
        public DbSet<CharValueTranslation> CharValueTranslations { get; set; }
        public DbSet<TranslationText> TranslationTexts { get; set; }
        public DbSet<UserProfile> UserProfiles { get; set; }
        public DbSet<Province> Provinces { get; set; }
        public DbSet<City> Cities { get; set; }
        public DbSet<Country> Countries { get; set; }
        public DbSet<Title> Titles { get; set; }
        public DbSet<Site> Sites { get; set; }
        public DbSet<SitePage> SitePages { get; set; }
        public DbSet<ContentHolder> ContentHolders { get; set; }
        public DbSet<ContentHolderPart> ContentHolderParts { get; set; }
        public DbSet<DynamicContent> DynamicContents { get; set; }
        public DbSet<PageLayout> PageLayouts { get; set; }
        public DbSet<SitePageParameter> SitePageParameters { get; set; }
        public DbSet<Continent> Continents { get; set; }
        public DbSet<Log> Logs { get; set; }
        public DbSet<StaticContent> StaticContents { get; set; }

        public CenturyDbContext()
            : base("DefaultConnection")
        {
            //DropAndReCreate if in debug and model is changed. 
            //if (System.Diagnostics.Debugger.IsAttached)
            //{
            //    Database.SetInitializer(new DropCreateDatabaseIfModelChanges<CenturyDbContext>()); 
            //}
        }


        //protected override void OnModelCreating(DbModelBuilder modelBuilder)
        //{

        //    modelBuilder.Configurations.Add(new UserMaps());
        //    modelBuilder.Configurations.Add(new RolePermissionItemMap());


        //    base.OnModelCreating(modelBuilder);
        //}

    }
}
